package com.example.service;

import com.example.entity.City;
import com.example.entity.Flight;
import com.example.entity.FlightDetail;
import com.example.entity.Ticket;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface FlightService {
    void commit();
    void rollback();
    List<String> getTop4ArrivalCities();
    List<String> getTop4DepartureCities();
    Flight searchCheapestFlight(String departure, String destination, String departureDate);
    int isCityExist(String city);
    City getNearCity(String city);
    List<Flight> searchFlights(String departure, String destination, Date departureDate);
    List<FlightDetail> searchFlightDetails(String departure, String destination, Date departureDate);
    int addACityPoint(String city);
    int addDCityPoint(String city);
    //添加航班
    int addPlane(String p_model, String p_airline, String build_date, String WiFi, int capacity, int economy_seat, int business_seat, int first_seat);
    int getLastPlaneId();
    int addFlight(String f_model, int plane_id, String f_airline, String departure_airport, String arrival_airport, String departure_city, String arrival_city, String departure_date, String departure_time, String arrival_date, String arrival_time, double distance, double economy_price, double business_price, double first_price, int baggage_limit, String meal, String meal_money, String gate);
    int getLastFlightId();
    int addFlightStatus(int f_id, String date, String captain, String assistant_captain, String chief_attendant, int flight_crew_num, int economy_space, int first_space, int business_space, String status);

    //改签
    Ticket getTicketById(int t_id);
    Flight getFlightById(int f_id);
}

